<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script src="../common.js" type="text/javascript" charset="utf-8"></script>
    <script>
        // 通过日期对象，获取100天之后是星期几
        var weeks = ["7", "1", "2", "3", "4", "5", "6"];
        var date = new Date(),  //以下数据为date对象创建时产生
            year = date.getFullYear(), //得到年份
            month = date.getMonth(),  //得到月份
            today = date.getDate(),  //得到天
            milliSeconds = date.getMilliseconds(); //得到毫秒
        var temp = new Date(year, month, today + 100);  //设置100天后 
        // document.write(temp.getFullYear() + "-" +
        //     (temp.getMonth() + 1) + "-" + temp.getDate() +
        //     "-" + weeks[temp.getDay()]);  //打印100天后的日期

        /*
            Date.parse();
        */
        var t1 = Date.parse("2019-1-31");
        var t2 = new Date(t1);
        /*
            Format date
        */

        setInterval(function () {
            var date1 = new Date();
            str = date2string(date1);
            clock.innerHTML = str;
        }, 1000);



    </script>
    <div id="clock">

    </div>
</body>

</html>